/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wwcontrolserver.controls;

/**
 *
 * @author Michael Ferry
 */
public class ControlKey {
    private final int InterfaceSerial;
    private final Integer SubInterfaceID;
    
    public ControlKey(int InterfaceSerial){
        this.InterfaceSerial = InterfaceSerial;
        this.SubInterfaceID = null;
    }
    public ControlKey(int InterfaceSerial, Integer SubInterfaceID){
        this.InterfaceSerial = InterfaceSerial;
        this.SubInterfaceID = SubInterfaceID;
    }
    public int GetInterfaceSerial(){
        return InterfaceSerial;
    }
    public int GetSubInterfaceID(){
        return SubInterfaceID;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 29 * hash + this.InterfaceSerial;
        hash = 29 * hash + (this.SubInterfaceID != null ? this.SubInterfaceID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ControlKey other = (ControlKey) obj;
        if (this.InterfaceSerial != other.InterfaceSerial) {
            return false;
        }
        if (this.SubInterfaceID != other.SubInterfaceID && (this.SubInterfaceID == null || !this.SubInterfaceID.equals(other.SubInterfaceID))) {
            return false;
        }
        return true;
    }
    
}
